package com.lovesher.payment.service.resposity.dao;
import java.util.List;
import java.util.Map;

import com.lovesher.payment.common.resposity.bean.AccountRechargeDTO;
import com.lovesher.payment.common.resposity.bean.PaymentSerial;
import com.lovesher.payment.common.resposity.bean.TransferDTO;
import com.lovesher.payment.common.resposity.bean.TransferResultDTO;
import com.lovesher.payment.service.resposity.base.DaoBase;

/**
 * 
 * PaymentSerialDao
 * 
 **/
public interface PaymentSerialDao extends DaoBase<PaymentSerial>{

	/**
	 * 根据编号查找收款单
	 * 
	 * @param id
	 * 
	 * @return 收款单，若不存在则返回null
	 */
	public PaymentSerial findByOrderSn(String orderSn,Long userId);
	
	/**
	 * 根据编号查找收款单
	 * 
	 * @param id
	 * 
	 * @return 收款单，若不存在则返回null
	 */
	public PaymentSerial findByOrderSnAndType(String orderSn,Long userId,Integer type);
	
	/**
	 * 发送支付请求
	 * 
	 * @param accountRechargeDTO
	 * @return
	 */
	public Map<String,String> sendPayReq(AccountRechargeDTO accountRechargeDTO);

	/**
	 * 查询订单是否已经支付完成
	 * @param tradeNo
	 * @param userId
	 * @return
	 */
	public Boolean hasExist(String tradeNo,Long userId);
	
	
	public PaymentSerial findByTradeNo(String tradeNo,Long userId);

	public List<PaymentSerial> getListByStatus(Integer taskStatus, int status, Integer cpos, Integer size,
			List<String> paymentMethods, Integer secTime);

	/**
	 * 支付宝转账
	 * @param transferDTO
	 * @return
	 */
	public TransferResultDTO doTransfer(TransferDTO transferDTO);
	
}